#ifndef XGE_XPLUG_CONFIG_H_
#define XGE_XPLUG_CONFIG_H_
#include "xge_common_config.h"
#include "xallocator.h"
#include "xdata_structure.h"
#include "xallstatic.h"
#include "xstring.h"

namespace xge{
namespace xge_internal{

  // A plug config is a piece of config file which
  // is located in the same folder of the .exe .
  // Its name is fixed : PlugConfig.xml  . It
  // will not change .
  // The file will looks like : 

  // <PlugConfig> 
  //   <Plug Path="path of the plug" Type="FileSystem" />
  //   <Plug Path="path of the plug" Type="RenderSystem"/>
  // </PlugConfig>

  class XPlugConfig : public XAllStatic {
  public:
    enum {
      PLUG_FILE_SYSTEM  = 0 , // File system plug in
      PLUG_RENDER_SYSTEM= 1   // Renderer system plug in
    };
  public:
    struct PlugElement {
      XString plug_loading_path ; 
      int plug_type ;
    };
  public:
    // Initialize the plug config
    static bool Initialize();
    // Destroy the plug config
    static bool Destroy();
    // Acquire the plug-in information
    static PlugElement* Acquire( int type , size_t index );
    static size_t NumberOfElement( int type );
  private:
    typedef xge::list< PlugElement* >::XList PlugElementList;
    typedef xge::list< PlugElementList* > PlugTypeList;
    static PlugElementList* kPlugListEntry;
  };

}// namespace xge_internal
}//namespace xge



#endif// XGE_XPLUG_CONFIG_H_